<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        class Hero {
            constructor(name) {
                this.name = name;

            }
            age = 12;
            play = () => {
                console.log('play');
            }
            run = function () {
                console.log('run');
            }
            eat() {
                console.log('吃鸡');
            }
        }
        let a = new Hero('剑圣');
        console.log(a);
        console.log(a.age);
        console.log(a.name);
        a.play();
        a.run();
        a.eat();
        console.log(a);
    </script>
</body>

</html>